//
//  TodayHomeMoreCell.m
//  TourPlay
//
//  Created by dllo on 15/11/19.
//  Copyright © 2015年 王军岐. All rights reserved.
//

#import "TodayHomeMoreCell.h"
#define HEIGHT 6
#define WIDTH 6

@interface TodayHomeMoreCell ()

@property (nonatomic, retain) UILabel *timeL;

@end

@implementation TodayHomeMoreCell

- (void)dealloc
{
    [_timeL release];
    [super dealloc];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}
- (void)createSubViews
{
    NSInteger imageWidth = 21;
    UIView *viewBack = [[UIView alloc] initWithFrame:CGRectMake(7 + imageWidth + 5, 0, SCREEN_WIDTH - (7 + imageWidth + 5 + WIDTH), 45 * AUTOSCREEN_HEIGHT)];

    viewBack.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.9];
    // 圆角
    viewBack.layer.cornerRadius = 4.f;
    [self.contentView addSubview:viewBack];
    [viewBack release];
    
    self.timeL = [[UILabel alloc] initWithFrame:viewBack.frame];
    self.timeL.textAlignment = NSTextAlignmentCenter;
    self.timeL.font = [UIFont systemFontOfSize:14.5f * AUTOSCREEN_HEIGHT];
    [self.contentView addSubview:self.timeL];
    [_timeL release];
    
    UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(viewBack.frame.size.width - 12, viewBack.frame.size.height / 2.f - 6, 4.8, 12)];
    imageV.image = [UIImage imageNamed:@"find_calendar_switching_right_notclickable@2x.png"];
//    imageV.backgroundColor = [UIColor orangeColor];
    [viewBack addSubview:imageV];
    [imageV release];
    
    [self addColorChangedBlock:^{
        viewBack.nightBackgroundColor = [ColorSingleton shareSingleton].cellColor;
        viewBack.normalBackgroundColor = [ColorSingleton shareSingleton].cellColor;
        self.timeL.normalTextColor = [ColorSingleton shareSingleton].cellTitleColor;
        self.timeL.nightTextColor = [ColorSingleton shareSingleton].cellTitleColor;
    }];
}
- (void)setTimeLabelWithString:(NSString *)str
{
    self.timeL.text = [NSString stringWithFormat:@"查看 %@ 更多项目", str];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
